home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '90 / Other Stuff / Lookup ƒ / LookupDeclaration < prev    next >
Encoding:
Text File  |  1988-05-08  |  957 b   |  25 lines  |  [TEXT/MPS ]

  1. #    LookupDeclaration - look up the declaration for a pascal identifier
  2. #
  3. #    Usage:
  4. #        Don't call from a window or a script.
  5. #        LookupDeclaration should be installed in the menu by
  6. #            AddMenu Find 'Lookup Declaration/L' "LookupDeclaration ≥ Dev:Null"
  7. #
  8. #    LookupDeclaration grabs the pascal identifier selected in the active window,
  9. #    and opens the interface file defining that identifier at the declaration.
  10. #
  11. #    Copyright Norbert Lindenberg 1988
  12. #    All rights reserved.
  13.  
  14. Set Tokensep "[¬a-zA-Z_0-9]"
  15. Find Δ\{Tokensep}\!1 "{Active}" || Find •  "{Active}"
  16. Find §:Δ/{Tokensep}/ "{Active}" || Find §:∞ "{Active}"
  17. Set Pattern `Catenate "{Active}".§` ≥ Dev:Null || ∂
  18.     ( Alert -s ∂
  19.         'Sorry, cannot figure out the identifier you want to have explained.'; ∂
  20.       Exit 1)
  21. SearchDeclaration -a -r "{Pattern}" > "{MPW}"OpenDeclaration ≥ Dev:Null || ∂
  22.     ( Alert -s "Sorry, no declaration found for ∂"{Pattern}∂"." ; Exit 1)
  23. "{MPW}"OpenDeclaration ≥ Dev:Null || Exit 1
  24. Exit 0
  25.